import { createRouter, createWebHistory } from 'vue-router'
import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout/index.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },

  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('@/views/index/index.vue')
      },
   
      // {
      //   path: '/rent-calculation',
      //   name: 'calculation',
      //   children: [
      //     {
      //       path: '/rent-calculation',
      //       name: 'rent-calculation',
      //       component: () => import('@/views/calculation/index.vue')
      //     },
      //     {
      //       path: '/rent-calculation/schedule',
      //       name: 'schedule',
      //       meta: {
      //         title: '还款计划',
      //         icon: 'el-icon-s-platform',
      //         noCache: true,
      //         affix: true
      //       },
      //       component: () => import('@/views/calculation/schedule.vue')
      //     }
      //   ]
      // },
    
      // ... 其他路由
    ]
  }
]
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
